<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"  isELIgnored="false"%>

<html>
<link rel="stylesheet" href="/static/css/layui.css"  media="all">
<link rel="stylesheet" href="/static/css/MyStyle.css"  media="all">

<body>
<div class="layui-form">

    <table  class="layui-table">
        <tr>
            <td>id</td>
            <td>name</td>
            <td>password</td>
            <td>sex</td>
            <td>birthday</td>
            <td>registTime</td>
            <td>
                <button type="button" class="layui-btn"><i class="layui-icon">操作</i></button>
                <a href="/user/toAdd" class="layui-btn layui-btn-warm" >新增</a>
            </td>
        </tr>
        <c:forEach var="i" items="${pageInfo.getList()}">
            <tr>
                <td>${i.id}</td>
                <td>${i.name}</td>
                <td>${i.password}</td>
                <td>${i.sex}</td>
                <td>
                    <fmt:formatDate value="${i.birthday}" pattern="yyyy/MM/dd"></fmt:formatDate>
                </td>
                <td>
                    <fmt:formatDate value="${i.registTime}" pattern="yyyy/MM/dd"></fmt:formatDate>
                </td>
                <td>
                    <a href="/user/updateUid/${i.id}"  class="layui-btn layui-btn-normal">修改</a>
                    <a href="/user/deleteById/${i.id}" class="layui-btn layui-btn-danger">删除</a>
                </td>
            </tr>
        </c:forEach>

    </table>
    <div class="pageCenter">
        <a href="/user/showAll/1"  class="layui-btn layui-btn-normal layui-btn-sm">首页</a>
        <a href="/user/showAll/${pageInfo.getPageNum()-1<1?pageInfo.getPageNum():pageInfo.getPageNum()-1}"  class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i></a>
        <c:forEach  begin="1" end="${pageInfo.getPages()}" varStatus="i">
            <a href="/user/showAll/${i.count}" class="pageStyle">${i.count}</a>
        </c:forEach>
        <a href="/user/showAll/${pageInfo.getPageNum()+1>pageInfo.getPages()?pageInfo.getPageNum():pageInfo.getPageNum()+1}" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i></a>
        <a href="/user/showAll/${pageInfo.pages}"  class="layui-btn layui-btn-normal layui-btn-sm">尾页</a>
        <span>当前第:${pageInfo.getPageNum()}页/共:${pageInfo.getPages()}页</span>
    </div>

</div>

</body>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="/static/layui.js" charset="utf-8"></script>
<script>

</script>
</html>
